#ifndef _FRACTAL_FTURTLE_H_
#define _FRACTAL_FTURTLE_H_


#include <stack>
#include "fvector.hpp"


struct TurtState
{
    FVector2d pos;
    double angle;

    TurtState(double x=0.0, double y=0.0, double angle=0.0);
    TurtState(const FVector2d &pos, double angle=0.0);
};


typedef std::stack<TurtState> TurtStateStack;


struct Turtle
{
    TurtState state;

    Turtle(double x=0.0, double y=0.0, double angle=0.0);
    Turtle(const FVector2d &pos, double angle=0.0);
    Turtle(const TurtState &start);
    
    void forward(double step);
    void turn_left(double deg);
    void turn_right(double deg);

    void remember(void);
    void restore(void);

private:
    TurtStateStack _pos_stack;
};


#endif  // _FRACTAL_FTURTLE_H_
